package com.xjcs.saplingplan.room.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.xjcs.saplingplan.room.bean.AppUserInfo
import kotlinx.coroutines.flow.Flow

@Dao
interface AppUserDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(data: AppUserInfo)

    @Query("select * from AppUserInfo where appUserId = :userId")
    fun getAppUserInfo(userId: String): AppUserInfo?

    @Query("select * from AppUserInfo")
    fun getAllUserInfo(): Flow<List<AppUserInfo>>

}